package com.example.design.strategyDemo;

public enum DesignEnum {

    EAT("eat", "eatStrategy"),
    SELLP("sleep", "sleepStrategy");

    private String doCode;

    private String beanName;

    DesignEnum(String doCode, String beanName) {
        this.doCode = doCode;
        this.beanName = beanName;
    }

    public static String getBeanName(String doCode) {
        for (DesignEnum designEnum : DesignEnum.values()) {
            if (designEnum.doCode.equals(doCode)) {
                return designEnum.beanName;
            }
        }
        return "";
    }

}
